In [1]:
from IPython.display import Image
from IPython.core.display import HTML
from urllib import request
HTML(request.urlopen('http://bit.ly/1Bf5Hft').read().decode('UTF-8'))

from numpy import linspace, sqrt, log, cos
from scipy.constants import epsilon_0, h, hbar, pi, elementary_charge, c
from scipy.special import ellipk
from scipy import signal
import numpy as np

import plotly.plotly as py
from plotly.tools import mpl_to_plotly
from plotly.offline import init_notebook_mode, iplot_mpl, iplot
init_notebook_mode()

import sys
sys.path.append('/mnt/labshare/Programs/python/HelperFunctions/')
from myfunctions import *
from plottingFunctions import *
from plotlylayouts import *

import pandas as pd
import re
from os import path, listdir


Overview

This is a capture JPM from Madison, with both the JPM and cavity hooked up in reflection. Only the cavity seems visible.


In [2]:
datafiles = []
logfiles = []
for file in listdir('/mnt/labshare/User/Caleb/'):
    if file.endswith('.log'):
        logfiles.append(path.join('/mnt/labshare/User/Caleb/', file))
    if file.endswith('mag.dat'):
        datafiles.append(path.join('/mnt/labshare/User/Caleb/', file))

In [ ]:
for index in arange(len(datafiles)):
    log = dict()
    z = np.loadtxt(datafiles[index])
    print("Index {}".format(index))
    with open(logfiles[index]) as f:
        for line in f.readlines():
            line = line.strip('#')
            text = line.split(':')
#             print(text)
            log[text[0].strip()] = float(text[1].strip())
#     print(log)
    log['freqaxis'] = np.linspace(log['startFreq'], log['endFreq'], log['numPoints'])
    log['voltaxis'] = np.arange(log['startVolt'], log['endVolt'], log['stepVolt'])
#     print()
    py.plot(Figure(data=[Heatmap(x = log['voltaxis'], y = log['freqaxis'], z=z)]), filename="JPM/CaptureJPM/09012016:I3/" + datafiles[index].split('/')[-1], show=False)


Index 0
Index 1

In [ ]:
py.plot?

In [33]:
print(x)


# startVolt : -5 
# stepVolt : 0.2 
# power : -30 
# endVolt : 5 
# startFreq : 4550000000.0 
# numPoints : 801 
# IFbandwidth : 500 
# endFreq : 4570000000.0 
# avg : 1 


In [45]:
file = open(logfiles[0])
f = np.loadtxt(file, delimiter=':', dtype='String')
file.close()


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-45-9970be6db02a> in <module>()
      1 file = open(logfiles[0])
----> 2 f = np.loadtxt(file, delimiter=':', dtype='String')
      3 file.close()

/home/anaconda3/lib/python3.5/site-packages/numpy/lib/npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin)
    873     try:
    874         # Make sure we're dealing with a proper dtype
--> 875         dtype = np.dtype(dtype)
    876         defconv = _getconv(dtype)
    877 

TypeError: data type "String" not understood

In [44]:
with open(logfiles[0]) as f:
    key, attr = f.split(':')


Out[44]:
array([], 
      dtype='<U1')

JPM Spectroscopy

I performed two tone spectroscopy on the JPM through the capture cavity, which worked suprisingly well.


In [46]:
datapath = '/mnt/labshare/User/Caleb/spect'

datafiles = []
logfiles = []
for file in listdir(datapath):
    if file.endswith('.log'):
        logfiles.append(path.join(datapath, file))
    if file.endswith('mag.dat'):
        datafiles.append(path.join(datapath, file))

In [84]:
logs = []
log = dict()
datas = []
figs = []

for index in arange(len(datafiles)):
    z = np.loadtxt(datafiles[index])
    print("Index {}".format(index))
    with open(logfiles[index]) as f:
        for line in f.readlines():
            line = line.strip('#')
            text = line.split(':')
#             print(text)
            log[text[0].strip()] = float(text[1].strip())
    log['freqaxis'] = np.linspace(log['Spec freq start'], log['Spec freq end'], (log['Spec freq end'] - log['Spec freq start'])/log['Spec step Freq'])
    logs.append(log)
    print(log)
    datas.append(z)
    fig = Figure(data=[Heatmap(z=z, y=log['freqaxis'])])
    figs.append(fig)
    iplot(fig)


Index 0
{'Spec freq start': 5000000000.0, 'avg': 10.0, 'numPoints': 100.0, 'readout Freq': 4561560000.0, 'freqaxis': array([  5.00000000e+09,   5.00100100e+09,   5.00200200e+09,
         5.00300300e+09,   5.00400400e+09,   5.00500501e+09,
         5.00600601e+09,   5.00700701e+09,   5.00800801e+09,
         5.00900901e+09,   5.01001001e+09,   5.01101101e+09,
         5.01201201e+09,   5.01301301e+09,   5.01401401e+09,
         5.01501502e+09,   5.01601602e+09,   5.01701702e+09,
         5.01801802e+09,   5.01901902e+09,   5.02002002e+09,
         5.02102102e+09,   5.02202202e+09,   5.02302302e+09,
         5.02402402e+09,   5.02502503e+09,   5.02602603e+09,
         5.02702703e+09,   5.02802803e+09,   5.02902903e+09,
         5.03003003e+09,   5.03103103e+09,   5.03203203e+09,
         5.03303303e+09,   5.03403403e+09,   5.03503504e+09,
         5.03603604e+09,   5.03703704e+09,   5.03803804e+09,
         5.03903904e+09,   5.04004004e+09,   5.04104104e+09,
         5.04204204e+09,   5.04304304e+09,   5.04404404e+09,
         5.04504505e+09,   5.04604605e+09,   5.04704705e+09,
         5.04804805e+09,   5.04904905e+09,   5.05005005e+09,
         5.05105105e+09,   5.05205205e+09,   5.05305305e+09,
         5.05405405e+09,   5.05505506e+09,   5.05605606e+09,
         5.05705706e+09,   5.05805806e+09,   5.05905906e+09,
         5.06006006e+09,   5.06106106e+09,   5.06206206e+09,
         5.06306306e+09,   5.06406406e+09,   5.06506507e+09,
         5.06606607e+09,   5.06706707e+09,   5.06806807e+09,
         5.06906907e+09,   5.07007007e+09,   5.07107107e+09,
         5.07207207e+09,   5.07307307e+09,   5.07407407e+09,
         5.07507508e+09,   5.07607608e+09,   5.07707708e+09,
         5.07807808e+09,   5.07907908e+09,   5.08008008e+09,
         5.08108108e+09,   5.08208208e+09,   5.08308308e+09,
         5.08408408e+09,   5.08508509e+09,   5.08608609e+09,
         5.08708709e+09,   5.08808809e+09,   5.08908909e+09,
         5.09009009e+09,   5.09109109e+09,   5.09209209e+09,
         5.09309309e+09,   5.09409409e+09,   5.09509510e+09,
         5.09609610e+09,   5.09709710e+09,   5.09809810e+09,
         5.09909910e+09,   5.10010010e+09,   5.10110110e+09,
         5.10210210e+09,   5.10310310e+09,   5.10410410e+09,
         5.10510511e+09,   5.10610611e+09,   5.10710711e+09,
         5.10810811e+09,   5.10910911e+09,   5.11011011e+09,
         5.11111111e+09,   5.11211211e+09,   5.11311311e+09,
         5.11411411e+09,   5.11511512e+09,   5.11611612e+09,
         5.11711712e+09,   5.11811812e+09,   5.11911912e+09,
         5.12012012e+09,   5.12112112e+09,   5.12212212e+09,
         5.12312312e+09,   5.12412412e+09,   5.12512513e+09,
         5.12612613e+09,   5.12712713e+09,   5.12812813e+09,
         5.12912913e+09,   5.13013013e+09,   5.13113113e+09,
         5.13213213e+09,   5.13313313e+09,   5.13413413e+09,
         5.13513514e+09,   5.13613614e+09,   5.13713714e+09,
         5.13813814e+09,   5.13913914e+09,   5.14014014e+09,
         5.14114114e+09,   5.14214214e+09,   5.14314314e+09,
         5.14414414e+09,   5.14514515e+09,   5.14614615e+09,
         5.14714715e+09,   5.14814815e+09,   5.14914915e+09,
         5.15015015e+09,   5.15115115e+09,   5.15215215e+09,
         5.15315315e+09,   5.15415415e+09,   5.15515516e+09,
         5.15615616e+09,   5.15715716e+09,   5.15815816e+09,
         5.15915916e+09,   5.16016016e+09,   5.16116116e+09,
         5.16216216e+09,   5.16316316e+09,   5.16416416e+09,
         5.16516517e+09,   5.16616617e+09,   5.16716717e+09,
         5.16816817e+09,   5.16916917e+09,   5.17017017e+09,
         5.17117117e+09,   5.17217217e+09,   5.17317317e+09,
         5.17417417e+09,   5.17517518e+09,   5.17617618e+09,
         5.17717718e+09,   5.17817818e+09,   5.17917918e+09,
         5.18018018e+09,   5.18118118e+09,   5.18218218e+09,
         5.18318318e+09,   5.18418418e+09,   5.18518519e+09,
         5.18618619e+09,   5.18718719e+09,   5.18818819e+09,
         5.18918919e+09,   5.19019019e+09,   5.19119119e+09,
         5.19219219e+09,   5.19319319e+09,   5.19419419e+09,
         5.19519520e+09,   5.19619620e+09,   5.19719720e+09,
         5.19819820e+09,   5.19919920e+09,   5.20020020e+09,
         5.20120120e+09,   5.20220220e+09,   5.20320320e+09,
         5.20420420e+09,   5.20520521e+09,   5.20620621e+09,
         5.20720721e+09,   5.20820821e+09,   5.20920921e+09,
         5.21021021e+09,   5.21121121e+09,   5.21221221e+09,
         5.21321321e+09,   5.21421421e+09,   5.21521522e+09,
         5.21621622e+09,   5.21721722e+09,   5.21821822e+09,
         5.21921922e+09,   5.22022022e+09,   5.22122122e+09,
         5.22222222e+09,   5.22322322e+09,   5.22422422e+09,
         5.22522523e+09,   5.22622623e+09,   5.22722723e+09,
         5.22822823e+09,   5.22922923e+09,   5.23023023e+09,
         5.23123123e+09,   5.23223223e+09,   5.23323323e+09,
         5.23423423e+09,   5.23523524e+09,   5.23623624e+09,
         5.23723724e+09,   5.23823824e+09,   5.23923924e+09,
         5.24024024e+09,   5.24124124e+09,   5.24224224e+09,
         5.24324324e+09,   5.24424424e+09,   5.24524525e+09,
         5.24624625e+09,   5.24724725e+09,   5.24824825e+09,
         5.24924925e+09,   5.25025025e+09,   5.25125125e+09,
         5.25225225e+09,   5.25325325e+09,   5.25425425e+09,
         5.25525526e+09,   5.25625626e+09,   5.25725726e+09,
         5.25825826e+09,   5.25925926e+09,   5.26026026e+09,
         5.26126126e+09,   5.26226226e+09,   5.26326326e+09,
         5.26426426e+09,   5.26526527e+09,   5.26626627e+09,
         5.26726727e+09,   5.26826827e+09,   5.26926927e+09,
         5.27027027e+09,   5.27127127e+09,   5.27227227e+09,
         5.27327327e+09,   5.27427427e+09,   5.27527528e+09,
         5.27627628e+09,   5.27727728e+09,   5.27827828e+09,
         5.27927928e+09,   5.28028028e+09,   5.28128128e+09,
         5.28228228e+09,   5.28328328e+09,   5.28428428e+09,
         5.28528529e+09,   5.28628629e+09,   5.28728729e+09,
         5.28828829e+09,   5.28928929e+09,   5.29029029e+09,
         5.29129129e+09,   5.29229229e+09,   5.29329329e+09,
         5.29429429e+09,   5.29529530e+09,   5.29629630e+09,
         5.29729730e+09,   5.29829830e+09,   5.29929930e+09,
         5.30030030e+09,   5.30130130e+09,   5.30230230e+09,
         5.30330330e+09,   5.30430430e+09,   5.30530531e+09,
         5.30630631e+09,   5.30730731e+09,   5.30830831e+09,
         5.30930931e+09,   5.31031031e+09,   5.31131131e+09,
         5.31231231e+09,   5.31331331e+09,   5.31431431e+09,
         5.31531532e+09,   5.31631632e+09,   5.31731732e+09,
         5.31831832e+09,   5.31931932e+09,   5.32032032e+09,
         5.32132132e+09,   5.32232232e+09,   5.32332332e+09,
         5.32432432e+09,   5.32532533e+09,   5.32632633e+09,
         5.32732733e+09,   5.32832833e+09,   5.32932933e+09,
         5.33033033e+09,   5.33133133e+09,   5.33233233e+09,
         5.33333333e+09,   5.33433433e+09,   5.33533534e+09,
         5.33633634e+09,   5.33733734e+09,   5.33833834e+09,
         5.33933934e+09,   5.34034034e+09,   5.34134134e+09,
         5.34234234e+09,   5.34334334e+09,   5.34434434e+09,
         5.34534535e+09,   5.34634635e+09,   5.34734735e+09,
         5.34834835e+09,   5.34934935e+09,   5.35035035e+09,
         5.35135135e+09,   5.35235235e+09,   5.35335335e+09,
         5.35435435e+09,   5.35535536e+09,   5.35635636e+09,
         5.35735736e+09,   5.35835836e+09,   5.35935936e+09,
         5.36036036e+09,   5.36136136e+09,   5.36236236e+09,
         5.36336336e+09,   5.36436436e+09,   5.36536537e+09,
         5.36636637e+09,   5.36736737e+09,   5.36836837e+09,
         5.36936937e+09,   5.37037037e+09,   5.37137137e+09,
         5.37237237e+09,   5.37337337e+09,   5.37437437e+09,
         5.37537538e+09,   5.37637638e+09,   5.37737738e+09,
         5.37837838e+09,   5.37937938e+09,   5.38038038e+09,
         5.38138138e+09,   5.38238238e+09,   5.38338338e+09,
         5.38438438e+09,   5.38538539e+09,   5.38638639e+09,
         5.38738739e+09,   5.38838839e+09,   5.38938939e+09,
         5.39039039e+09,   5.39139139e+09,   5.39239239e+09,
         5.39339339e+09,   5.39439439e+09,   5.39539540e+09,
         5.39639640e+09,   5.39739740e+09,   5.39839840e+09,
         5.39939940e+09,   5.40040040e+09,   5.40140140e+09,
         5.40240240e+09,   5.40340340e+09,   5.40440440e+09,
         5.40540541e+09,   5.40640641e+09,   5.40740741e+09,
         5.40840841e+09,   5.40940941e+09,   5.41041041e+09,
         5.41141141e+09,   5.41241241e+09,   5.41341341e+09,
         5.41441441e+09,   5.41541542e+09,   5.41641642e+09,
         5.41741742e+09,   5.41841842e+09,   5.41941942e+09,
         5.42042042e+09,   5.42142142e+09,   5.42242242e+09,
         5.42342342e+09,   5.42442442e+09,   5.42542543e+09,
         5.42642643e+09,   5.42742743e+09,   5.42842843e+09,
         5.42942943e+09,   5.43043043e+09,   5.43143143e+09,
         5.43243243e+09,   5.43343343e+09,   5.43443443e+09,
         5.43543544e+09,   5.43643644e+09,   5.43743744e+09,
         5.43843844e+09,   5.43943944e+09,   5.44044044e+09,
         5.44144144e+09,   5.44244244e+09,   5.44344344e+09,
         5.44444444e+09,   5.44544545e+09,   5.44644645e+09,
         5.44744745e+09,   5.44844845e+09,   5.44944945e+09,
         5.45045045e+09,   5.45145145e+09,   5.45245245e+09,
         5.45345345e+09,   5.45445445e+09,   5.45545546e+09,
         5.45645646e+09,   5.45745746e+09,   5.45845846e+09,
         5.45945946e+09,   5.46046046e+09,   5.46146146e+09,
         5.46246246e+09,   5.46346346e+09,   5.46446446e+09,
         5.46546547e+09,   5.46646647e+09,   5.46746747e+09,
         5.46846847e+09,   5.46946947e+09,   5.47047047e+09,
         5.47147147e+09,   5.47247247e+09,   5.47347347e+09,
         5.47447447e+09,   5.47547548e+09,   5.47647648e+09,
         5.47747748e+09,   5.47847848e+09,   5.47947948e+09,
         5.48048048e+09,   5.48148148e+09,   5.48248248e+09,
         5.48348348e+09,   5.48448448e+09,   5.48548549e+09,
         5.48648649e+09,   5.48748749e+09,   5.48848849e+09,
         5.48948949e+09,   5.49049049e+09,   5.49149149e+09,
         5.49249249e+09,   5.49349349e+09,   5.49449449e+09,
         5.49549550e+09,   5.49649650e+09,   5.49749750e+09,
         5.49849850e+09,   5.49949950e+09,   5.50050050e+09,
         5.50150150e+09,   5.50250250e+09,   5.50350350e+09,
         5.50450450e+09,   5.50550551e+09,   5.50650651e+09,
         5.50750751e+09,   5.50850851e+09,   5.50950951e+09,
         5.51051051e+09,   5.51151151e+09,   5.51251251e+09,
         5.51351351e+09,   5.51451451e+09,   5.51551552e+09,
         5.51651652e+09,   5.51751752e+09,   5.51851852e+09,
         5.51951952e+09,   5.52052052e+09,   5.52152152e+09,
         5.52252252e+09,   5.52352352e+09,   5.52452452e+09,
         5.52552553e+09,   5.52652653e+09,   5.52752753e+09,
         5.52852853e+09,   5.52952953e+09,   5.53053053e+09,
         5.53153153e+09,   5.53253253e+09,   5.53353353e+09,
         5.53453453e+09,   5.53553554e+09,   5.53653654e+09,
         5.53753754e+09,   5.53853854e+09,   5.53953954e+09,
         5.54054054e+09,   5.54154154e+09,   5.54254254e+09,
         5.54354354e+09,   5.54454454e+09,   5.54554555e+09,
         5.54654655e+09,   5.54754755e+09,   5.54854855e+09,
         5.54954955e+09,   5.55055055e+09,   5.55155155e+09,
         5.55255255e+09,   5.55355355e+09,   5.55455455e+09,
         5.55555556e+09,   5.55655656e+09,   5.55755756e+09,
         5.55855856e+09,   5.55955956e+09,   5.56056056e+09,
         5.56156156e+09,   5.56256256e+09,   5.56356356e+09,
         5.56456456e+09,   5.56556557e+09,   5.56656657e+09,
         5.56756757e+09,   5.56856857e+09,   5.56956957e+09,
         5.57057057e+09,   5.57157157e+09,   5.57257257e+09,
         5.57357357e+09,   5.57457457e+09,   5.57557558e+09,
         5.57657658e+09,   5.57757758e+09,   5.57857858e+09,
         5.57957958e+09,   5.58058058e+09,   5.58158158e+09,
         5.58258258e+09,   5.58358358e+09,   5.58458458e+09,
         5.58558559e+09,   5.58658659e+09,   5.58758759e+09,
         5.58858859e+09,   5.58958959e+09,   5.59059059e+09,
         5.59159159e+09,   5.59259259e+09,   5.59359359e+09,
         5.59459459e+09,   5.59559560e+09,   5.59659660e+09,
         5.59759760e+09,   5.59859860e+09,   5.59959960e+09,
         5.60060060e+09,   5.60160160e+09,   5.60260260e+09,
         5.60360360e+09,   5.60460460e+09,   5.60560561e+09,
         5.60660661e+09,   5.60760761e+09,   5.60860861e+09,
         5.60960961e+09,   5.61061061e+09,   5.61161161e+09,
         5.61261261e+09,   5.61361361e+09,   5.61461461e+09,
         5.61561562e+09,   5.61661662e+09,   5.61761762e+09,
         5.61861862e+09,   5.61961962e+09,   5.62062062e+09,
         5.62162162e+09,   5.62262262e+09,   5.62362362e+09,
         5.62462462e+09,   5.62562563e+09,   5.62662663e+09,
         5.62762763e+09,   5.62862863e+09,   5.62962963e+09,
         5.63063063e+09,   5.63163163e+09,   5.63263263e+09,
         5.63363363e+09,   5.63463463e+09,   5.63563564e+09,
         5.63663664e+09,   5.63763764e+09,   5.63863864e+09,
         5.63963964e+09,   5.64064064e+09,   5.64164164e+09,
         5.64264264e+09,   5.64364364e+09,   5.64464464e+09,
         5.64564565e+09,   5.64664665e+09,   5.64764765e+09,
         5.64864865e+09,   5.64964965e+09,   5.65065065e+09,
         5.65165165e+09,   5.65265265e+09,   5.65365365e+09,
         5.65465465e+09,   5.65565566e+09,   5.65665666e+09,
         5.65765766e+09,   5.65865866e+09,   5.65965966e+09,
         5.66066066e+09,   5.66166166e+09,   5.66266266e+09,
         5.66366366e+09,   5.66466466e+09,   5.66566567e+09,
         5.66666667e+09,   5.66766767e+09,   5.66866867e+09,
         5.66966967e+09,   5.67067067e+09,   5.67167167e+09,
         5.67267267e+09,   5.67367367e+09,   5.67467467e+09,
         5.67567568e+09,   5.67667668e+09,   5.67767768e+09,
         5.67867868e+09,   5.67967968e+09,   5.68068068e+09,
         5.68168168e+09,   5.68268268e+09,   5.68368368e+09,
         5.68468468e+09,   5.68568569e+09,   5.68668669e+09,
         5.68768769e+09,   5.68868869e+09,   5.68968969e+09,
         5.69069069e+09,   5.69169169e+09,   5.69269269e+09,
         5.69369369e+09,   5.69469469e+09,   5.69569570e+09,
         5.69669670e+09,   5.69769770e+09,   5.69869870e+09,
         5.69969970e+09,   5.70070070e+09,   5.70170170e+09,
         5.70270270e+09,   5.70370370e+09,   5.70470470e+09,
         5.70570571e+09,   5.70670671e+09,   5.70770771e+09,
         5.70870871e+09,   5.70970971e+09,   5.71071071e+09,
         5.71171171e+09,   5.71271271e+09,   5.71371371e+09,
         5.71471471e+09,   5.71571572e+09,   5.71671672e+09,
         5.71771772e+09,   5.71871872e+09,   5.71971972e+09,
         5.72072072e+09,   5.72172172e+09,   5.72272272e+09,
         5.72372372e+09,   5.72472472e+09,   5.72572573e+09,
         5.72672673e+09,   5.72772773e+09,   5.72872873e+09,
         5.72972973e+09,   5.73073073e+09,   5.73173173e+09,
         5.73273273e+09,   5.73373373e+09,   5.73473473e+09,
         5.73573574e+09,   5.73673674e+09,   5.73773774e+09,
         5.73873874e+09,   5.73973974e+09,   5.74074074e+09,
         5.74174174e+09,   5.74274274e+09,   5.74374374e+09,
         5.74474474e+09,   5.74574575e+09,   5.74674675e+09,
         5.74774775e+09,   5.74874875e+09,   5.74974975e+09,
         5.75075075e+09,   5.75175175e+09,   5.75275275e+09,
         5.75375375e+09,   5.75475475e+09,   5.75575576e+09,
         5.75675676e+09,   5.75775776e+09,   5.75875876e+09,
         5.75975976e+09,   5.76076076e+09,   5.76176176e+09,
         5.76276276e+09,   5.76376376e+09,   5.76476476e+09,
         5.76576577e+09,   5.76676677e+09,   5.76776777e+09,
         5.76876877e+09,   5.76976977e+09,   5.77077077e+09,
         5.77177177e+09,   5.77277277e+09,   5.77377377e+09,
         5.77477477e+09,   5.77577578e+09,   5.77677678e+09,
         5.77777778e+09,   5.77877878e+09,   5.77977978e+09,
         5.78078078e+09,   5.78178178e+09,   5.78278278e+09,
         5.78378378e+09,   5.78478478e+09,   5.78578579e+09,
         5.78678679e+09,   5.78778779e+09,   5.78878879e+09,
         5.78978979e+09,   5.79079079e+09,   5.79179179e+09,
         5.79279279e+09,   5.79379379e+09,   5.79479479e+09,
         5.79579580e+09,   5.79679680e+09,   5.79779780e+09,
         5.79879880e+09,   5.79979980e+09,   5.80080080e+09,
         5.80180180e+09,   5.80280280e+09,   5.80380380e+09,
         5.80480480e+09,   5.80580581e+09,   5.80680681e+09,
         5.80780781e+09,   5.80880881e+09,   5.80980981e+09,
         5.81081081e+09,   5.81181181e+09,   5.81281281e+09,
         5.81381381e+09,   5.81481481e+09,   5.81581582e+09,
         5.81681682e+09,   5.81781782e+09,   5.81881882e+09,
         5.81981982e+09,   5.82082082e+09,   5.82182182e+09,
         5.82282282e+09,   5.82382382e+09,   5.82482482e+09,
         5.82582583e+09,   5.82682683e+09,   5.82782783e+09,
         5.82882883e+09,   5.82982983e+09,   5.83083083e+09,
         5.83183183e+09,   5.83283283e+09,   5.83383383e+09,
         5.83483483e+09,   5.83583584e+09,   5.83683684e+09,
         5.83783784e+09,   5.83883884e+09,   5.83983984e+09,
         5.84084084e+09,   5.84184184e+09,   5.84284284e+09,
         5.84384384e+09,   5.84484484e+09,   5.84584585e+09,
         5.84684685e+09,   5.84784785e+09,   5.84884885e+09,
         5.84984985e+09,   5.85085085e+09,   5.85185185e+09,
         5.85285285e+09,   5.85385385e+09,   5.85485485e+09,
         5.85585586e+09,   5.85685686e+09,   5.85785786e+09,
         5.85885886e+09,   5.85985986e+09,   5.86086086e+09,
         5.86186186e+09,   5.86286286e+09,   5.86386386e+09,
         5.86486486e+09,   5.86586587e+09,   5.86686687e+09,
         5.86786787e+09,   5.86886887e+09,   5.86986987e+09,
         5.87087087e+09,   5.87187187e+09,   5.87287287e+09,
         5.87387387e+09,   5.87487487e+09,   5.87587588e+09,
         5.87687688e+09,   5.87787788e+09,   5.87887888e+09,
         5.87987988e+09,   5.88088088e+09,   5.88188188e+09,
         5.88288288e+09,   5.88388388e+09,   5.88488488e+09,
         5.88588589e+09,   5.88688689e+09,   5.88788789e+09,
         5.88888889e+09,   5.88988989e+09,   5.89089089e+09,
         5.89189189e+09,   5.89289289e+09,   5.89389389e+09,
         5.89489489e+09,   5.89589590e+09,   5.89689690e+09,
         5.89789790e+09,   5.89889890e+09,   5.89989990e+09,
         5.90090090e+09,   5.90190190e+09,   5.90290290e+09,
         5.90390390e+09,   5.90490490e+09,   5.90590591e+09,
         5.90690691e+09,   5.90790791e+09,   5.90890891e+09,
         5.90990991e+09,   5.91091091e+09,   5.91191191e+09,
         5.91291291e+09,   5.91391391e+09,   5.91491491e+09,
         5.91591592e+09,   5.91691692e+09,   5.91791792e+09,
         5.91891892e+09,   5.91991992e+09,   5.92092092e+09,
         5.92192192e+09,   5.92292292e+09,   5.92392392e+09,
         5.92492492e+09,   5.92592593e+09,   5.92692693e+09,
         5.92792793e+09,   5.92892893e+09,   5.92992993e+09,
         5.93093093e+09,   5.93193193e+09,   5.93293293e+09,
         5.93393393e+09,   5.93493493e+09,   5.93593594e+09,
         5.93693694e+09,   5.93793794e+09,   5.93893894e+09,
         5.93993994e+09,   5.94094094e+09,   5.94194194e+09,
         5.94294294e+09,   5.94394394e+09,   5.94494494e+09,
         5.94594595e+09,   5.94694695e+09,   5.94794795e+09,
         5.94894895e+09,   5.94994995e+09,   5.95095095e+09,
         5.95195195e+09,   5.95295295e+09,   5.95395395e+09,
         5.95495495e+09,   5.95595596e+09,   5.95695696e+09,
         5.95795796e+09,   5.95895896e+09,   5.95995996e+09,
         5.96096096e+09,   5.96196196e+09,   5.96296296e+09,
         5.96396396e+09,   5.96496496e+09,   5.96596597e+09,
         5.96696697e+09,   5.96796797e+09,   5.96896897e+09,
         5.96996997e+09,   5.97097097e+09,   5.97197197e+09,
         5.97297297e+09,   5.97397397e+09,   5.97497497e+09,
         5.97597598e+09,   5.97697698e+09,   5.97797798e+09,
         5.97897898e+09,   5.97997998e+09,   5.98098098e+09,
         5.98198198e+09,   5.98298298e+09,   5.98398398e+09,
         5.98498498e+09,   5.98598599e+09,   5.98698699e+09,
         5.98798799e+09,   5.98898899e+09,   5.98998999e+09,
         5.99099099e+09,   5.99199199e+09,   5.99299299e+09,
         5.99399399e+09,   5.99499499e+09,   5.99599600e+09,
         5.99699700e+09,   5.99799800e+09,   5.99899900e+09,
         6.00000000e+09]), 'readout Power': -45.0, 'Spec step Freq': 1000000.0, 'Spec freq end': 6000000000.0, 'Spec power': -10.0, 'volt': -2.78, 'IFbandwidth': 500.0}
Index 1
{'Spec freq start': 5000000000.0, 'avg': 1.0, 'numPoints': 100.0, 'readout Freq': 4561560000.0, 'freqaxis': array([  5.00000000e+09,   5.01010101e+09,   5.02020202e+09,
         5.03030303e+09,   5.04040404e+09,   5.05050505e+09,
         5.06060606e+09,   5.07070707e+09,   5.08080808e+09,
         5.09090909e+09,   5.10101010e+09,   5.11111111e+09,
         5.12121212e+09,   5.13131313e+09,   5.14141414e+09,
         5.15151515e+09,   5.16161616e+09,   5.17171717e+09,
         5.18181818e+09,   5.19191919e+09,   5.20202020e+09,
         5.21212121e+09,   5.22222222e+09,   5.23232323e+09,
         5.24242424e+09,   5.25252525e+09,   5.26262626e+09,
         5.27272727e+09,   5.28282828e+09,   5.29292929e+09,
         5.30303030e+09,   5.31313131e+09,   5.32323232e+09,
         5.33333333e+09,   5.34343434e+09,   5.35353535e+09,
         5.36363636e+09,   5.37373737e+09,   5.38383838e+09,
         5.39393939e+09,   5.40404040e+09,   5.41414141e+09,
         5.42424242e+09,   5.43434343e+09,   5.44444444e+09,
         5.45454545e+09,   5.46464646e+09,   5.47474747e+09,
         5.48484848e+09,   5.49494949e+09,   5.50505051e+09,
         5.51515152e+09,   5.52525253e+09,   5.53535354e+09,
         5.54545455e+09,   5.55555556e+09,   5.56565657e+09,
         5.57575758e+09,   5.58585859e+09,   5.59595960e+09,
         5.60606061e+09,   5.61616162e+09,   5.62626263e+09,
         5.63636364e+09,   5.64646465e+09,   5.65656566e+09,
         5.66666667e+09,   5.67676768e+09,   5.68686869e+09,
         5.69696970e+09,   5.70707071e+09,   5.71717172e+09,
         5.72727273e+09,   5.73737374e+09,   5.74747475e+09,
         5.75757576e+09,   5.76767677e+09,   5.77777778e+09,
         5.78787879e+09,   5.79797980e+09,   5.80808081e+09,
         5.81818182e+09,   5.82828283e+09,   5.83838384e+09,
         5.84848485e+09,   5.85858586e+09,   5.86868687e+09,
         5.87878788e+09,   5.88888889e+09,   5.89898990e+09,
         5.90909091e+09,   5.91919192e+09,   5.92929293e+09,
         5.93939394e+09,   5.94949495e+09,   5.95959596e+09,
         5.96969697e+09,   5.97979798e+09,   5.98989899e+09,
         6.00000000e+09]), 'readout Power': -45.0, 'Spec step Freq': 10000000.0, 'Spec freq end': 6000000000.0, 'Spec power': -10.0, 'volt': -2.78, 'IFbandwidth': 500.0}
Index 2
{'Spec freq start': 5000000000.0, 'avg': 1.0, 'numPoints': 100.0, 'readout Freq': 4561560000.0, 'freqaxis': array([  5.00000000e+09,   5.01010101e+09,   5.02020202e+09,
         5.03030303e+09,   5.04040404e+09,   5.05050505e+09,
         5.06060606e+09,   5.07070707e+09,   5.08080808e+09,
         5.09090909e+09,   5.10101010e+09,   5.11111111e+09,
         5.12121212e+09,   5.13131313e+09,   5.14141414e+09,
         5.15151515e+09,   5.16161616e+09,   5.17171717e+09,
         5.18181818e+09,   5.19191919e+09,   5.20202020e+09,
         5.21212121e+09,   5.22222222e+09,   5.23232323e+09,
         5.24242424e+09,   5.25252525e+09,   5.26262626e+09,
         5.27272727e+09,   5.28282828e+09,   5.29292929e+09,
         5.30303030e+09,   5.31313131e+09,   5.32323232e+09,
         5.33333333e+09,   5.34343434e+09,   5.35353535e+09,
         5.36363636e+09,   5.37373737e+09,   5.38383838e+09,
         5.39393939e+09,   5.40404040e+09,   5.41414141e+09,
         5.42424242e+09,   5.43434343e+09,   5.44444444e+09,
         5.45454545e+09,   5.46464646e+09,   5.47474747e+09,
         5.48484848e+09,   5.49494949e+09,   5.50505051e+09,
         5.51515152e+09,   5.52525253e+09,   5.53535354e+09,
         5.54545455e+09,   5.55555556e+09,   5.56565657e+09,
         5.57575758e+09,   5.58585859e+09,   5.59595960e+09,
         5.60606061e+09,   5.61616162e+09,   5.62626263e+09,
         5.63636364e+09,   5.64646465e+09,   5.65656566e+09,
         5.66666667e+09,   5.67676768e+09,   5.68686869e+09,
         5.69696970e+09,   5.70707071e+09,   5.71717172e+09,
         5.72727273e+09,   5.73737374e+09,   5.74747475e+09,
         5.75757576e+09,   5.76767677e+09,   5.77777778e+09,
         5.78787879e+09,   5.79797980e+09,   5.80808081e+09,
         5.81818182e+09,   5.82828283e+09,   5.83838384e+09,
         5.84848485e+09,   5.85858586e+09,   5.86868687e+09,
         5.87878788e+09,   5.88888889e+09,   5.89898990e+09,
         5.90909091e+09,   5.91919192e+09,   5.92929293e+09,
         5.93939394e+09,   5.94949495e+09,   5.95959596e+09,
         5.96969697e+09,   5.97979798e+09,   5.98989899e+09,
         6.00000000e+09]), 'readout Power': -50.0, 'Spec step Freq': 10000000.0, 'Spec freq end': 6000000000.0, 'Spec power': -10.0, 'volt': -2.78, 'IFbandwidth': 500.0}
Index 3
{'Spec freq start': 4800000000.0, 'avg': 100.0, 'numPoints': 100.0, 'readout Freq': 4561610000.0, 'freqaxis': array([  4.80000000e+09,   4.82033898e+09,   4.84067797e+09,
         4.86101695e+09,   4.88135593e+09,   4.90169492e+09,
         4.92203390e+09,   4.94237288e+09,   4.96271186e+09,
         4.98305085e+09,   5.00338983e+09,   5.02372881e+09,
         5.04406780e+09,   5.06440678e+09,   5.08474576e+09,
         5.10508475e+09,   5.12542373e+09,   5.14576271e+09,
         5.16610169e+09,   5.18644068e+09,   5.20677966e+09,
         5.22711864e+09,   5.24745763e+09,   5.26779661e+09,
         5.28813559e+09,   5.30847458e+09,   5.32881356e+09,
         5.34915254e+09,   5.36949153e+09,   5.38983051e+09,
         5.41016949e+09,   5.43050847e+09,   5.45084746e+09,
         5.47118644e+09,   5.49152542e+09,   5.51186441e+09,
         5.53220339e+09,   5.55254237e+09,   5.57288136e+09,
         5.59322034e+09,   5.61355932e+09,   5.63389831e+09,
         5.65423729e+09,   5.67457627e+09,   5.69491525e+09,
         5.71525424e+09,   5.73559322e+09,   5.75593220e+09,
         5.77627119e+09,   5.79661017e+09,   5.81694915e+09,
         5.83728814e+09,   5.85762712e+09,   5.87796610e+09,
         5.89830508e+09,   5.91864407e+09,   5.93898305e+09,
         5.95932203e+09,   5.97966102e+09,   6.00000000e+09]), 'readout Power': -45.0, 'Spec step Freq': 20000000.0, 'Spec freq end': 6000000000.0, 'Spec power': -10.0, 'volt': -2.78, 'IFbandwidth': 20000.0}
Index 4
{'Spec freq start': 5000000000.0, 'avg': 100.0, 'numPoints': 100.0, 'readout Freq': 4561610000.0, 'freqaxis': array([  5.00000000e+09,   5.02040816e+09,   5.04081633e+09,
         5.06122449e+09,   5.08163265e+09,   5.10204082e+09,
         5.12244898e+09,   5.14285714e+09,   5.16326531e+09,
         5.18367347e+09,   5.20408163e+09,   5.22448980e+09,
         5.24489796e+09,   5.26530612e+09,   5.28571429e+09,
         5.30612245e+09,   5.32653061e+09,   5.34693878e+09,
         5.36734694e+09,   5.38775510e+09,   5.40816327e+09,
         5.42857143e+09,   5.44897959e+09,   5.46938776e+09,
         5.48979592e+09,   5.51020408e+09,   5.53061224e+09,
         5.55102041e+09,   5.57142857e+09,   5.59183673e+09,
         5.61224490e+09,   5.63265306e+09,   5.65306122e+09,
         5.67346939e+09,   5.69387755e+09,   5.71428571e+09,
         5.73469388e+09,   5.75510204e+09,   5.77551020e+09,
         5.79591837e+09,   5.81632653e+09,   5.83673469e+09,
         5.85714286e+09,   5.87755102e+09,   5.89795918e+09,
         5.91836735e+09,   5.93877551e+09,   5.95918367e+09,
         5.97959184e+09,   6.00000000e+09]), 'readout Power': -45.0, 'Spec step Freq': 20000000.0, 'Spec freq end': 6000000000.0, 'Spec power': -10.0, 'volt': -2.78, 'IFbandwidth': 20000.0}
Index 5
{'Spec freq start': 4800000000.0, 'avg': 100.0, 'numPoints': 100.0, 'readout Freq': 4562110000.0, 'freqaxis': array([  4.80000000e+09,   4.81005917e+09,   4.82011834e+09,
         4.83017751e+09,   4.84023669e+09,   4.85029586e+09,
         4.86035503e+09,   4.87041420e+09,   4.88047337e+09,
         4.89053254e+09,   4.90059172e+09,   4.91065089e+09,
         4.92071006e+09,   4.93076923e+09,   4.94082840e+09,
         4.95088757e+09,   4.96094675e+09,   4.97100592e+09,
         4.98106509e+09,   4.99112426e+09,   5.00118343e+09,
         5.01124260e+09,   5.02130178e+09,   5.03136095e+09,
         5.04142012e+09,   5.05147929e+09,   5.06153846e+09,
         5.07159763e+09,   5.08165680e+09,   5.09171598e+09,
         5.10177515e+09,   5.11183432e+09,   5.12189349e+09,
         5.13195266e+09,   5.14201183e+09,   5.15207101e+09,
         5.16213018e+09,   5.17218935e+09,   5.18224852e+09,
         5.19230769e+09,   5.20236686e+09,   5.21242604e+09,
         5.22248521e+09,   5.23254438e+09,   5.24260355e+09,
         5.25266272e+09,   5.26272189e+09,   5.27278107e+09,
         5.28284024e+09,   5.29289941e+09,   5.30295858e+09,
         5.31301775e+09,   5.32307692e+09,   5.33313609e+09,
         5.34319527e+09,   5.35325444e+09,   5.36331361e+09,
         5.37337278e+09,   5.38343195e+09,   5.39349112e+09,
         5.40355030e+09,   5.41360947e+09,   5.42366864e+09,
         5.43372781e+09,   5.44378698e+09,   5.45384615e+09,
         5.46390533e+09,   5.47396450e+09,   5.48402367e+09,
         5.49408284e+09,   5.50414201e+09,   5.51420118e+09,
         5.52426036e+09,   5.53431953e+09,   5.54437870e+09,
         5.55443787e+09,   5.56449704e+09,   5.57455621e+09,
         5.58461538e+09,   5.59467456e+09,   5.60473373e+09,
         5.61479290e+09,   5.62485207e+09,   5.63491124e+09,
         5.64497041e+09,   5.65502959e+09,   5.66508876e+09,
         5.67514793e+09,   5.68520710e+09,   5.69526627e+09,
         5.70532544e+09,   5.71538462e+09,   5.72544379e+09,
         5.73550296e+09,   5.74556213e+09,   5.75562130e+09,
         5.76568047e+09,   5.77573964e+09,   5.78579882e+09,
         5.79585799e+09,   5.80591716e+09,   5.81597633e+09,
         5.82603550e+09,   5.83609467e+09,   5.84615385e+09,
         5.85621302e+09,   5.86627219e+09,   5.87633136e+09,
         5.88639053e+09,   5.89644970e+09,   5.90650888e+09,
         5.91656805e+09,   5.92662722e+09,   5.93668639e+09,
         5.94674556e+09,   5.95680473e+09,   5.96686391e+09,
         5.97692308e+09,   5.98698225e+09,   5.99704142e+09,
         6.00710059e+09,   6.01715976e+09,   6.02721893e+09,
         6.03727811e+09,   6.04733728e+09,   6.05739645e+09,
         6.06745562e+09,   6.07751479e+09,   6.08757396e+09,
         6.09763314e+09,   6.10769231e+09,   6.11775148e+09,
         6.12781065e+09,   6.13786982e+09,   6.14792899e+09,
         6.15798817e+09,   6.16804734e+09,   6.17810651e+09,
         6.18816568e+09,   6.19822485e+09,   6.20828402e+09,
         6.21834320e+09,   6.22840237e+09,   6.23846154e+09,
         6.24852071e+09,   6.25857988e+09,   6.26863905e+09,
         6.27869822e+09,   6.28875740e+09,   6.29881657e+09,
         6.30887574e+09,   6.31893491e+09,   6.32899408e+09,
         6.33905325e+09,   6.34911243e+09,   6.35917160e+09,
         6.36923077e+09,   6.37928994e+09,   6.38934911e+09,
         6.39940828e+09,   6.40946746e+09,   6.41952663e+09,
         6.42958580e+09,   6.43964497e+09,   6.44970414e+09,
         6.45976331e+09,   6.46982249e+09,   6.47988166e+09,
         6.48994083e+09,   6.50000000e+09]), 'readout Power': -45.0, 'Spec step Freq': 10000000.0, 'Spec freq end': 6500000000.0, 'Spec power': -10.0, 'volt': -2.5, 'IFbandwidth': 20000.0}

In [59]:
for log in logs:
    
    log['freqaxis'] = np.linspace(log['Spec freq start'], log['Spec freq end'], (log['Spec freq end'] - log['Spec freq start'])/log['Spec step Freq'])

In [62]:
log


Out[62]:
{'IFbandwidth': 20000.0,
 'Spec freq end': 6500000000.0,
 'Spec freq start': 4800000000.0,
 'Spec power': -10.0,
 'Spec step Freq': 10000000.0,
 'avg': 100.0,
 'freqaxis': array([  4.80000000e+09,   4.81005917e+09,   4.82011834e+09,
          4.83017751e+09,   4.84023669e+09,   4.85029586e+09,
          4.86035503e+09,   4.87041420e+09,   4.88047337e+09,
          4.89053254e+09,   4.90059172e+09,   4.91065089e+09,
          4.92071006e+09,   4.93076923e+09,   4.94082840e+09,
          4.95088757e+09,   4.96094675e+09,   4.97100592e+09,
          4.98106509e+09,   4.99112426e+09,   5.00118343e+09,
          5.01124260e+09,   5.02130178e+09,   5.03136095e+09,
          5.04142012e+09,   5.05147929e+09,   5.06153846e+09,
          5.07159763e+09,   5.08165680e+09,   5.09171598e+09,
          5.10177515e+09,   5.11183432e+09,   5.12189349e+09,
          5.13195266e+09,   5.14201183e+09,   5.15207101e+09,
          5.16213018e+09,   5.17218935e+09,   5.18224852e+09,
          5.19230769e+09,   5.20236686e+09,   5.21242604e+09,
          5.22248521e+09,   5.23254438e+09,   5.24260355e+09,
          5.25266272e+09,   5.26272189e+09,   5.27278107e+09,
          5.28284024e+09,   5.29289941e+09,   5.30295858e+09,
          5.31301775e+09,   5.32307692e+09,   5.33313609e+09,
          5.34319527e+09,   5.35325444e+09,   5.36331361e+09,
          5.37337278e+09,   5.38343195e+09,   5.39349112e+09,
          5.40355030e+09,   5.41360947e+09,   5.42366864e+09,
          5.43372781e+09,   5.44378698e+09,   5.45384615e+09,
          5.46390533e+09,   5.47396450e+09,   5.48402367e+09,
          5.49408284e+09,   5.50414201e+09,   5.51420118e+09,
          5.52426036e+09,   5.53431953e+09,   5.54437870e+09,
          5.55443787e+09,   5.56449704e+09,   5.57455621e+09,
          5.58461538e+09,   5.59467456e+09,   5.60473373e+09,
          5.61479290e+09,   5.62485207e+09,   5.63491124e+09,
          5.64497041e+09,   5.65502959e+09,   5.66508876e+09,
          5.67514793e+09,   5.68520710e+09,   5.69526627e+09,
          5.70532544e+09,   5.71538462e+09,   5.72544379e+09,
          5.73550296e+09,   5.74556213e+09,   5.75562130e+09,
          5.76568047e+09,   5.77573964e+09,   5.78579882e+09,
          5.79585799e+09,   5.80591716e+09,   5.81597633e+09,
          5.82603550e+09,   5.83609467e+09,   5.84615385e+09,
          5.85621302e+09,   5.86627219e+09,   5.87633136e+09,
          5.88639053e+09,   5.89644970e+09,   5.90650888e+09,
          5.91656805e+09,   5.92662722e+09,   5.93668639e+09,
          5.94674556e+09,   5.95680473e+09,   5.96686391e+09,
          5.97692308e+09,   5.98698225e+09,   5.99704142e+09,
          6.00710059e+09,   6.01715976e+09,   6.02721893e+09,
          6.03727811e+09,   6.04733728e+09,   6.05739645e+09,
          6.06745562e+09,   6.07751479e+09,   6.08757396e+09,
          6.09763314e+09,   6.10769231e+09,   6.11775148e+09,
          6.12781065e+09,   6.13786982e+09,   6.14792899e+09,
          6.15798817e+09,   6.16804734e+09,   6.17810651e+09,
          6.18816568e+09,   6.19822485e+09,   6.20828402e+09,
          6.21834320e+09,   6.22840237e+09,   6.23846154e+09,
          6.24852071e+09,   6.25857988e+09,   6.26863905e+09,
          6.27869822e+09,   6.28875740e+09,   6.29881657e+09,
          6.30887574e+09,   6.31893491e+09,   6.32899408e+09,
          6.33905325e+09,   6.34911243e+09,   6.35917160e+09,
          6.36923077e+09,   6.37928994e+09,   6.38934911e+09,
          6.39940828e+09,   6.40946746e+09,   6.41952663e+09,
          6.42958580e+09,   6.43964497e+09,   6.44970414e+09,
          6.45976331e+09,   6.46982249e+09,   6.47988166e+09,
          6.48994083e+09,   6.50000000e+09]),
 'numPoints': 100.0,
 'readout Freq': 4562110000.0,
 'readout Power': -45.0,
 'volt': -2.5}

In [83]:
figs[1].data[0]['x'] = linspace(1, -1, 41)
iplot(figs[1])



In [81]:
np.shape(figs[1].data[0]['z'])[1]


Out[81]:
41

In [ ]: